#ifndef _RADIAN_RENDER_WND_H_
#define  _RADIAN_RENDER_WND_H_

#include "RadianCommon.h"

/* Class defining the base render window.
   This is the base render window,which would be used
   in many visual module in the RadianEditor.
*/
class RadianRenderWnd
{
public:
	RadianRenderWnd(const Ogre::String& wndName,QWidget* parentWidget,bool isPrimaryWnd);
	virtual ~RadianRenderWnd();

public:
	
	/* Initialize the radian render window.
	*/
	virtual bool Initialize();	

	/* Create render widow and viewport.
	*/
	virtual void CreateRenderWindow();

	/* Create camera.
	*/
	virtual void CreateCamera();

	/* Addon setup.Such as skybox and ref-plane.
	*/
	virtual void SceneSetup();

	/* Create scene mgr.
	*/
	virtual void CreateSceneMgr();

	/* Create viewport.
	*/
	virtual void CreateViewPort();

	/* Draw.
	*/
	virtual void Update(float timeElapsed, bool realTime);

	/*Get scene mgr.
	*/
	Ogre::SceneManager* GetSceneMgr();

	/* Get camera.
	*/
	Ogre::Camera* GetCamera();

	/* Get viewport.
	*/
	Ogre::Viewport* GetViewport();

	/* Get the renderwindow.
	*/
	Ogre::RenderWindow* GetRenderWindow();

	/* Get viewport's background colour.
	*/
	Util::ColourValue GetBackgroundColour();

	/* Set viewport's background colour.
	*/
	void SetBackgroundColour(const Util::ColourValue& backColour);

	
	/* Set renderwindow's new size.
	*/
	void WindowResize(unsigned int width,unsigned int height);

protected:
	Ogre::String mRenderWndName;				// name of the render window.
	Ogre::SceneManager* mSceneMgr;				// scene manager.
	Ogre::Camera* mCamera;						// camera.
	Ogre::Viewport* mViewport;					// viewport.	
	Ogre::RenderWindow* mRenderWindow;			// ogre render widow.
	Util::ColourValue mBackgroundColour;		// background colour.
	Ogre::Light* mMainLight;					// main light.

	bool mIsPrimaryRenderWnd;					// is primary render wnd.
	QWidget* mParentWidget;					// parent widege.

	Ogre::SceneNode* mCameraNode;				// camera scene node.
};

#endif